import QtQuick 1.1

DialogLiquid {

    id: dlgQuery
    signal clickedOk
    signal clickedCancel

    property string title: ""
    property int fontTitleSize: 24

    property string text: ""
    property int fontTextSize: 22

    property string textButtonOk: "Ok"
    property string textButtonCancel: "Cancel"

    width: parent.width*0.9
    height: headerDlg.height + dlgText.height + rowButtons.height + dlgText.anchors.topMargin + rowButtons.anchors.topMargin + 20


    Rectangle {
        id: headerDlg
        anchors.top: parent.top
        anchors.left: parent.left
        width: parent.width
        height: 70
        gradient: Gradient {
            GradientStop { position: 0; color: "#919191" }
            GradientStop { position: 1; color: "#666666" }
        }
        Text {
            anchors.centerIn: parent
            font.pixelSize: dlgQuery.fontTitleSize
            color: "white"
            text: dlgQuery.title
        }
    }

    Text {
        id: dlgText
        anchors.top: headerDlg.bottom; anchors.topMargin: 20
        anchors.left: parent.left; anchors.leftMargin: 10
        font.pixelSize: dlgQuery.fontTextSize
        width: parent.width - 10
        text: dlgQuery.text
        clip: true
        HorizontalGradient {
            anchors.left: parent.left
            anchors.top: parent.top
            height: parent.height
            width: parent.width
            gradient: Gradient {
                GradientStop { color: "transparent"; position: 0 }
                GradientStop { color: "transparent"; position: 0.8 }
                GradientStop { color: "white"; position: 0.95 }
                GradientStop { color: "white"; position: 1 }
            }
        }
    }


    /****************************************************/
    Row {
        id: rowButtons
        anchors.top: dlgText.bottom; anchors.topMargin: 20
        anchors.left: parent.left; anchors.leftMargin: 10
        spacing: 20
        Button {
            id: buttonOk
            height: 70
            text: textButtonOk
            width: dlgQuery.width/2 - 20
            onClicked: {
                dlgQuery.clickedOk()
                dlgQuery.state = "hidden"
            }
        }
        Button {
            id: buttonCancel
            height: 70
            text: textButtonCancel
            width: dlgQuery.width/2 - 20
            onClicked: {
                dlgQuery.clickedCancel()
                dlgQuery.state = "hidden"
            }
        }
    }
    /****************************************************/
}
